﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Tools
{
    public partial class Tool
    {
        public static int getIntValue(string strValue)
        {
            int v = 0;
            int.TryParse(strValue, out v);
            return v;
        }

        public static decimal getDecimalValue(string strValue)
        {
            decimal v = 0;
            decimal.TryParse(strValue, out v);
            return v;
        }
        public static float getFloatValue(string strValue)
        {
            float v = 0;
            float.TryParse(strValue, out v);
            return v;
        }
        public static DateTime getDateTimeValue(string strValue)
        {
            DateTime v = new DateTime();
            try
            {
                v = DateTime.Parse(strValue);
            }
            catch
            {
                v = DateTime.Parse("1900-01-01 00:00:00");
            }
            return v;
        }
    }
}
